package com.wsl.clienta.Controller;

import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/test")
public class TController {


    @GetMapping("/getNum")
    public String getNum() throws InterruptedException {
        Thread.sleep(10000L);
        return "测试get请求远程调用";
    }

    @PostMapping("/postNum")
    public String PostNum() {
        return "测试POST请求远程调用";
    }

    @PostMapping("/postTest")
    public String PostNums(@RequestParam Integer num) {
        if (num == 0) {
            return "远程调用测试,参数0";
        } else if (num == 10) {
            return "远程调用测试,参数 10";
        } else {
            return "远程调用参数只支持0、10";
        }
    }
}


